import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { HttpClient } from '@angular/common/http';
import { UrlService } from 'src/app/common/url.service';
import { res } from 'src/app/common/Interface';
@Component({
  selector: 'app-person-center',
  templateUrl: './person-center.component.html',
  styleUrls: ['./person-center.component.less'],
})
export class PersonCenterComponent implements OnInit {
  constructor(private router: Router, private http: HttpClient) {}

  ngOnInit(): void {}
  logout() {
    this.http
      .get(`/user/logout`, {
        params: {
          userId: 1,
        },
      })
      .subscribe((res: res) => {
        if (res.code == 200) {
          this.router.navigateByUrl('');
        }
      });
  }
}
